package com.yide.myworld.mapper;

import com.yide.myworld.domain.MqFlow;
import com.yide.myworld.domain.MqFlowExample;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface MqFlowMapper extends BatchBaseMapper<MqFlow>{
    long countByExample(MqFlowExample example);

    int deleteByExample(MqFlowExample example);

    int deleteByPrimaryKey(String messageId);

    int insertSelective(MqFlow row);

    List<MqFlow> selectByExampleWithBLOBs(MqFlowExample example);

    List<MqFlow> selectByExample(MqFlowExample example);

    MqFlow selectByPrimaryKey(String messageId);

    int updateByExampleSelective(@Param("row") MqFlow row, @Param("example") MqFlowExample example);

    int updateByExampleWithBLOBs(@Param("row") MqFlow row, @Param("example") MqFlowExample example);

    int updateByExample(@Param("row") MqFlow row, @Param("example") MqFlowExample example);

    int updateByPrimaryKeySelective(MqFlow row);

    int updateByPrimaryKeyWithBLOBs(MqFlow row);

    int updateByPrimaryKey(MqFlow row);

    /**
     * 查询指定topic消费失败的mq消息集合
     * @param topic
     */
    @Select("SELECT * FROM `mq_flow` where topic = #{topic} and result != 'success'")
    List<MqFlow> selectConsumeFailMessageByTopic(String topic);
}